package com.gzsxy.esjy.service.auth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gzsxy.esjy.service.auth.entity.User;
import com.gzsxy.esjy.service.auth.entity.vo.UserQueryVo;
import com.gzsxy.esjy.service.base.dto.response.OrderRsp;
import com.gzsxy.esjy.service.base.dto.response.UserRsp;
import com.gzsxy.esjy.service.base.util.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author xiaolong
 * @version 1.0
 * @description: TODO
 * @date 2022/2/8 9:30
 */
@Repository
public interface UserMapper extends BaseMapper<User> {


    /**
     * @description: 是否存在该用户
     * @param userName 学号
     * @param school 学校
     * @return
     */
    Boolean existByUserName(@Param("userName") String userName,@Param("school") String school);


    /**
     * @description: 是否存在该用户
     * @param phone 手机号
     * @return
     */
    Boolean existByPhone(@Param("phone") String phone);

    /**
     * @description: 分页查询用户
     * @param
     * @return
     */
    IPage<UserRsp> getPageVo(Page<?> page, @Param("userQueryVo")  UserQueryVo userQueryVo);

    /**
     * @description: 根据当天日期查看注册用户人数
     * @param day 时间 精确天
     * @return
     */
    Integer selectRegisterNumByDay(String day);
}
